package com.xwyzsn.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xwyzsn.system.mapper.BorrowMapper;
import com.xwyzsn.system.domain.Borrow;
import com.xwyzsn.system.service.IBorrowService;

/**
 * 设备借还Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-21
 */
@Service
public class BorrowServiceImpl implements IBorrowService 
{
    @Autowired
    private BorrowMapper borrowMapper;

    /**
     * 查询设备借还
     * 
     * @param id 设备借还主键
     * @return 设备借还
     */
    @Override
    public Borrow selectBorrowById(Long id)
    {
        return borrowMapper.selectBorrowById(id);
    }

    /**
     * 查询设备借还列表
     * 
     * @param borrow 设备借还
     * @return 设备借还
     */
    @Override
    public List<Borrow> selectBorrowList(Borrow borrow)
    {
        return borrowMapper.selectBorrowList(borrow);
    }

    @Override
    public List<Borrow> selectAll() {
        return borrowMapper.selectAll();
    }

    /**
     * 新增设备借还
     * 
     * @param borrow 设备借还
     * @return 结果
     */
    @Override
    public int insertBorrow(Borrow borrow)
    {
        return borrowMapper.insertBorrow(borrow);
    }

    /**
     * 修改设备借还
     * 
     * @param borrow 设备借还
     * @return 结果
     */
    @Override
    public int updateBorrow(Borrow borrow)
    {
        return borrowMapper.updateBorrow(borrow);
    }

    /**
     * 批量删除设备借还
     * 
     * @param ids 需要删除的设备借还主键
     * @return 结果
     */
    @Override
    public int deleteBorrowByIds(Long[] ids)
    {
        return borrowMapper.deleteBorrowByIds(ids);
    }

    /**
     * 删除设备借还信息
     * 
     * @param id 设备借还主键
     * @return 结果
     */
    @Override
    public int deleteBorrowById(Long id)
    {
        return borrowMapper.deleteBorrowById(id);
    }
}
